<?php
/**
 * Created by PhpStorm.
 * User: meiyun1
 * Date: 2017/2/23
 * Time: 下午4:18
 */

namespace App\Models\ActivityModel;

use App\Contracts\Repositories\ActivityModelRepository as ActivityModel;

class ActivityModelService
{
    private $activityModel;

    public function __construct(ActivityModel $activityModel)
    {
        $this->activityModel = $activityModel;
    }

    public function create($data)
    {
        $model = new \App\Models\ActivityModel\ActivityModel($data);

        return $this->activityModel->create($model);
    }

    public function findAll()
    {
        return $this->activityModel->findAll();
    }

    /**
     * @param $id
     *
     * @return \App\Models\ActivityModel\ActivityModel
     */
    public function findOne($id)
    {
        return $this->activityModel->findOne($id);
    }
}
